package cn.agiledata.bank.transaction.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;

/**
 * 在线充值Form
 * 
 * @author maxianbo
 * 
 */
public class OnlineInpourForm extends InpourForm {

    private long bankId;

    private String orderId;

    private String returnCode;

    private String returnMessage;

    public OnlineInpourForm() {
        super();
        this.bankId = 0;
        this.orderId = "";
        this.returnCode = "";
        this.returnMessage = "";
    }

    /**
     * 
     * @return 充值银行id
     */
    public long getBankId() {
        return this.bankId;
    }

    /**
     * 
     * @param bankId
     *            充值银行id
     */
    public void setBankId(long bankId) {
        this.bankId = bankId;
    }

    /**
     * 
     * @return 订单编号（交易编号）
     */
    public String getOrderId() {
        return this.orderId;
    }

    /**
     * 
     * @param orderId
     *            订单编号（交易编号）
     */
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /**
     * 
     * @return 返回码
     */
    public String getReturnCode() {
        return this.returnCode;
    }

    /**
     * 
     * @param returnCode
     *            返回码
     */
    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    /**
     * 
     * @return 返回消息
     */
    public String getReturnMessage() {
        return this.returnMessage;
    }

    /**
     * 
     * @param returnMessage
     *            返回消息
     */
    public void setReturnMessage(String returnMessage) {
        this.returnMessage = returnMessage;
    }

    /**
     * 判断交易是否成功
     */
    public boolean isSuccessful() {
        return "0000".equals(getReturnCode());
    }

    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        if (isResetable()) {
            this.bankId = 0;
            this.orderId = "";
            this.returnCode = "";
            this.returnMessage = "";
        }
    }
}
